package com.dyypdadmin.service.impl;

import com.dyypdadmin.dao.DoctorsDao;
import com.dyypdadmin.pojo.Doctors;
import com.dyypdadmin.service.DoctorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DoctorsServiceImpl implements DoctorsService {
    @Autowired
    private DoctorsDao doctorsDao;
    @Override
//    获取医生列表
    public List<Doctors> getDoctersList() {
        return doctorsDao.selectList(null);
    }

    @Override
    public int addDoctor(String doctor_name, String doctor_gender, String expertise, Integer years_of_experience, String contact_number) {
        return doctorsDao.addDoctor(doctor_name, doctor_gender, expertise, years_of_experience, contact_number);
    }

    @Override
    public int updateDoctor(Doctors doctor) {
        return doctorsDao.updateById(doctor);
    }

    @Override
    public int delDoctor(int doctor_id) {
        return doctorsDao.delDoctor(doctor_id);
    }

    @Override
    public List<Doctors> getDoctorByName(String doctor_name) {
        return doctorsDao.getDoctorByName(doctor_name);
    }
}
